import React ,{Component} from 'react';
import './style/header.css'
class Header extends Component{
    constructor(props){
        super(props);
        this.state = {
            active:1,
        }
    }
    clickHead(index){
        this.setState({
            active:index,
        })
    }
    render(){
        return(
            <header className="header">
                <div>
                    logo
                </div>
                <ul>
                    <li onClick={this.clickHead.bind(this,1)} className={`tab_item ${this.state.active === 1 ? 'active' : '' }`}>
                        <span>A扫描</span>
                        <i></i>
                    </li>
                    <li onClick={this.clickHead.bind(this,2)} className={`tab_item ${this.state.active === 2 ? 'active' : '' }`}>
                        <span>B扫描</span>
                        <i></i>
                    </li>                
                </ul> 
            </header>
        )
    }
}

export default Header;